<%@page import="com.sinba.common.system.service.IRuleService"%>
<%@page import="com.sinba.common.system.dto.RuleDTO"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DecimalFormat"%>
<%@page import="com.sinba.common.system.dto.TransactionRecordDTO"%>
<%@page
	import="com.sinba.common.system.service.ITransactionRecordService"%>
<%@page import="com.sinba.common.user.dto.AccountDTO"%>
<%@page import="com.sinba.common.user.service.IAccountService"%>
<%@page import="com.sinba.common.news.dto.NewsContentDTO"%>
<%@page import="com.sinba.common.dto.PageDTO"%>
<%@page import="com.sinba.common.news.dto.NewsQueryDTO"%>
<%@page import="com.sinba.common.news.service.INewsService"%>
<%@page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
//获取当前浏览器语言做为默认的语言版本start
request.setAttribute("lang_defaultLanguage","zh_CN");
//request.setAttribute("lang_defaultLanguage","en_US");
//获取当前浏览器语言做为默认的语言版本end
String path = request.getContextPath() + "/" ;
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()	+ path ;
request.setAttribute("basePath", basePath);
%> 
<fmt:setLocale value="${empty cookie['language'].value?lang_defaultLanguage:cookie['language'].value}"/>
<fmt:setBundle basename="i18n.itilbase"/>
<c:set var="lang" scope="session" value="${empty cookie['language'].value?lang_defaultLanguage:cookie['language'].value}" />

<%
	if (session.getAttribute("loginName") == null) {
		response.sendRedirect("login.jsp");
		return;
	}
	ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	INewsService ns = (INewsService) ac.getBean("newsService");
	NewsQueryDTO queryDTO = new NewsQueryDTO();
	queryDTO.setNewType("WebAffiche");
	queryDTO.setLimit(6);
	PageDTO pagedto = ns.findNewsByCategory(queryDTO);

	NewsContentDTO content = ns
			.findTop1NewsByCategory(new NewsQueryDTO(null, null, null, null, null, "WebAffiche"));

	request.setAttribute("pagedto", pagedto);
	request.setAttribute("content", content);

	IRuleService ruleService = (IRuleService) ac.getBean("ruleService");
	RuleDTO ruleDTO = ruleService.findRuleInfo();
	request.setAttribute("ruleDTO", ruleDTO);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="../images/favicon.png" />
<title><fmt:message key="i18n.userCenter" />-${ruleDTO.rule002}</title>
<link href="${pageContext.request.contextPath}/skin/skin1/css/css.css" rel="stylesheet">
<link href="../skin/skin1/nav/css/main.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>

<script type="text/javascript" src="../skin/skin1/nav/js/main.js"></script>


<script type="text/javascript">
function hiddenBoxHide(){
	$('.hidden-box').css({"height":"1px","background":"#ede3d1"});
}

</script>

</head>

<body style="background: #ede3d1;">
<div class="account">
	<div class="top">
		<!--nav-->
		<div class="nav">
			<!--导航条-->
			<ul class="nav-main">
		        <li><a  href="main.jsp" onclick="hiddenBoxHide()" target="main" class="sy"><fmt:message key="i18n.firstPage" /></a></li>
				<li id="li-1"><a href="#" id="xxx"><fmt:message key="i18n.gerenManage" /></a><span></span></li>
				<li id="li-2"><a href="#"><fmt:message key="i18n.gerenManage" /></a><span></span></li>
				<li id="li-3"><a href="buy.jsp"  class="sy" target="main" onclick="hiddenBoxHide()">我的基本信息</a><span></span></li>
				<li id="li-4"><a href="#"><fmt:message key="i18n.moneyManage" /></a><span></span></li>
				<li id="li-5"><a href="#"><fmt:message key="i18n.xinxiManage" /></a><span></span></li>
			</ul>
			<!--隐藏盒子-->
			<div id="box-1" class="hidden-box hidden-loc-index">
				<ul>
					<%-- <li><a href="main.jsp" target="main"><fmt:message key="i18n.gerenIndexPage" /></a></li> --%>
		        	<li><a href="cp.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.updatePassword" /></a></li>
		        	<li><a href="pi.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.updateUserInfo" /></a></li>
		        	<li><a href="userUpgrade.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="title.userUpgrade" /></a></li>
				</ul>
			</div>
			<div id="box-2" class="hidden-box hidden-loc-us">
				<ul>
					<li><a href="genealogy.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.systemTu" /></a></li>
					<li><a href="declarationCenter.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.bdCenter" /></a></li>
					<li><a href="recommend.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.myTuiJian" /></a></li>
		        	<li><a href="myteamlist.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.myteam" /></a></li>
				</ul>
			</div>
			<%-- <div id="box-3" class="hidden-box hidden-loc-info box03">
				<ul>
					<li><a href="buy.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.myBuys" /></a></li>
					<li><a href="sell.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.mySells" /></a></li>
					<li><a href="matchBuy.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.matchList" /></a></li>
					<li><a href="matchBuy.jsp?status=0" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.remittanceList" /></a></li>
					<li><a href="matchSell.jsp?status=0" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.paymentList" /></a></li>
					<li><a href="matchSell.jsp?status=1" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.confirmList" /></a></li>
				</ul>
			</div> --%>
		    <div id="box-4" class="hidden-box hidden-loc-info box04">
				<ul>
					<li><a href="cashBusiness.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.acountTx" /></a></li>
					<li><a href="dynamicAward.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.jiangjinMX" /></a></li>
		        	<li><a href="dynamicAccountDetails.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.accountRecode" /></a></li>
		        	
				</ul>
			</div>
			<div id="box-5" class="hidden-box hidden-loc-info box05">
				<ul>
					<li><a href="imessage.jsp" onclick="hiddenBoxHide()" target="main"><fmt:message key="i18n.communStation" /></a></li>
				</ul>
			</div>
		</div>
		
		<div style="position: relative;z-index: 9999;float: right;padding-right: 120px;">
			<span style="color:orange;">${session.userName}</span>
			<input type="button" style="border: 1px solid;cursor: pointer;padding: 3px; width:60px; background: white;" onclick="mainrefresh()" value="<fmt:message key="i18n.shuaxin" />">
			<input type="button" style="border: 1px solid;cursor: pointer;padding: 3px;width:80px;background: white;" onclick="logout()" value="<fmt:message key="i18n.anquantuichu" />" />
		</div>
		
		<%-- <div id="mainNav">
			<div class="nav">
			<ul class="NavMain">
		        <li class="current">
		        	<a  href="main.jsp" target="main" class="sy"><fmt:message key="i18n.firstPage" /></a>
		        </li>
		        <li>
					<a href="#"><fmt:message key="i18n.gerenManage" /></a>
					<ul>
						<li><a href="main.jsp" target="main"><fmt:message key="i18n.gerenIndexPage" /></a></li>
		        		<li><a href="cp.jsp" target="main"><fmt:message key="i18n.updatePassword" /></a></li>
		        		<li><a href="pi.jsp" target="main"><fmt:message key="i18n.updateUserInfo" /></a></li>
		        	</ul>
		        </li>
		 
		        <li>
					<a href="#"><fmt:message key="i18n.yewuManage" /></a>
					<ul>
						<li><a href="recommend.jsp" target="main"><fmt:message key="i18n.myTuiJian" /></a></li>
		        		<li><a href="myteamlist.jsp" target="main"><fmt:message key="i18n.myteam" /></a></li>
		        		<li><a href="genealogy.jsp" target="main"><fmt:message key="i18n.systemTu" /></a></li>
		        	</ul>
		        </li>
		        
		        <li>
					<a href="#"><fmt:message key="i18n.tradeMg" /></a>
					<ul>
		        		<li><a href="buy.jsp" target="main"><fmt:message key="i18n.passis" /></a></li>
						<li><a href="sell.jsp" target="main"><fmt:message key="i18n.assis" /></a></li>
						<li><a href="matchBuy.jsp" target="main"><fmt:message key="i18n.matchList" /></a></li>
						<li><a href="matchBuy.jsp?status=0" target="main"><fmt:message key="i18n.remittanceList" /></a></li>
						<li><a href="matchSell.jsp?status=0" target="main"><fmt:message key="i18n.paymentList" /></a></li>
						<li><a href="matchSell.jsp?status=1" target="main"><fmt:message key="i18n.confirmList" /></a></li>
					</ul>
		        </li>
		        <li>
		        	<a href="#"><fmt:message key="i18n.moneyManage" /></a>
		        	<ul>
		        		<li><a href="dynamicAward.jsp" target="main"><fmt:message key="i18n.jiangjinMX" /></a></li>
		        		<li><a href="dynamicAccountDetails.jsp" target="main"><fmt:message key="i18n.accountRecode" /></a></li>
		        	</ul>
		        </li>
		        <li>
					<a href="#"><fmt:message key="i18n.xinxiManage" /></a>
					<ul>
						<li><a href="newsList.jsp?newType=WebAffiche" target="main"><fmt:message key="i18n.gonggaoguanli" /></a></li>
						<li><a href="newsList.jsp?newType=WebNews" target="main"><fmt:message key="i18n.news" /></a></li>
						<li><a href="imessage.jsp" target="main"><fmt:message key="i18n.communStation" /></a></li>
					</ul>
				</li>
				<li>
					<input type="button" style="border: 1px solid;cursor: pointer;padding: 3px;background: white;" onclick="mainrefresh()" value="<fmt:message key="i18n.shuaxin" />">
					<span style="color:orange;">${session.userName}</span>
					<input type="button" style="border: 1px solid;cursor: pointer;padding: 3px;background: white;" onclick="logout()" value="<fmt:message key="i18n.anquantuichu" />" />
					<button class="" href="javascript:mainrefresh()"> value="<fmt:message key="i18n.shuaxin" />" />
		        	&nbsp;&nbsp;
		     		 ${session.userName}&nbsp;&nbsp;<a href="javascript:logout()"><fmt:message key="i18n.anquantuichu" /></a>
		     		 
				</li>
			</ul>
	    	</div>
		</div> --%>
	</div>
	<div class="right">
		<div style="margin-left:auto; margin-right:auto;width: 90%;">
		<iframe id="main" name="main" scrolling="no"
			onload="javascript:dyniframesize('main');" src="main.jsp"
			frameborder=0 scrolling=yes
			style="margin-left: 0px; margin-top: 0px; width: 100%; height: 1000px"></iframe>
		</div>
	</div>
</div>
	<script type="text/javascript">
		function dyniframesize(down) {
			var ifm = document.getElementById(down);
			var subWeb = document.frames ? document.frames[down].document
					: ifm.contentDocument;
			if (ifm != null && subWeb != null) {
				if (subWeb.body.scrollHeight < 500) {
					ifm.height = 800;
				} else {
					ifm.height = subWeb.body.scrollHeight;
				}

				parent.scrollTo(0, 0);
			}

		}
		function logout() {
			if (confirm("确定退出吗?")) {
				window.top.location.href = 'logout.jsp';
			}
		}
		function setCookie(c_name, value, exdays) {

			var exdate = new Date();
			exdate.setDate(exdate.getDate() + exdays);
			var c_value = escape(value)
					+ ((exdays == null) ? "" : "; expires="
							+ exdate.toUTCString());
			document.cookie = c_name + "=" + c_value;
		}
		function setLanguage(lang) {
			setCookie('language', lang, 300);
			window.top.location.reload();
		}
		function mainrefresh() {
			document.getElementById("main").contentWindow.location.reload(true);
		}
		$(function() {
			$("#mobileQrcode_word").mouseover(function() {
				$("#mobileQrcode").show();
			});
			$("#mobileQrcode_word").mouseout(function() {
				$("#mobileQrcode").hide();
			});
		});
	</script>
	
</body>
</html>